package com.basin.micro.auth.module.role.pojo.dto;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serial;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;

/**
 * @author: Sam ZHONG | sammy1997@aliyun.com
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class RoleDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = -5629682266453412776L;

    @NotEmpty(message = "角色编码必填", groups = {UpdateGroup.class, AddGroup.class})
    private String roleCode;
    @NotEmpty(message = "角色名称必填", groups = {UpdateGroup.class, AddGroup.class})
    private String roleName;
    private String roleDesc;
    @Min(message = "角色状态码无效", value = 0, groups = {AddGroup.class, UpdateGroup.class})
    @Max(message = "角色状态码无效", value = 1, groups = {AddGroup.class, UpdateGroup.class})
    private Integer roleStatus;

    private Collection<String> menus = new HashSet<>();
    private Collection<String> perms = new HashSet<>();
    private Collection<String> emps = new HashSet<>();

    public interface AddGroup {
    }

    public interface UpdateGroup {
    }

}
